#include "stdafx.h"
#include "MonthSupervisePlanDetail.h"
#include "ui_MonthSupervisePlanDetail.h"

MonthSupervisePlanDetail::MonthSupervisePlanDetail(QWidget *parent) :
    QDialog(parent),
	ui(new Ui::MonthSupervisePlanDetail)
{
    ui->setupUi(this);
}
MonthSupervisePlanDetail::MonthSupervisePlanDetail(QString str,QWidget *parent) :
    QDialog(parent),
	ui(new Ui::MonthSupervisePlanDetail)
{
	ui->setupUi(this);
    QString sheetId = str;
    QString sql = QString("select USER_NAME,ORGAN_NAME,DEPT_NAME,lvl,position from jxd_tdjh_dgjd where sheetid = '%1'").arg(sheetId);

	pTableModel = new QRecordCheckTableModel;
	pEditTableDelegate = new QEditTableDelegate();
	ui->tableView->setModel(pTableModel);
	ui->tableView->setItemDelegate(pEditTableDelegate);

	pTableModel->select(sql, true);
    pTableModel->setCol(0, CF_SHOW, tr("xingming"));
	pTableModel->setCol(1, CF_SHOW, tr("danwei"));
	pTableModel->setCol(2, CF_SHOW, tr("bumen"));
	pTableModel->setCol(3, CF_SHOW, tr("jibie"));
	pTableModel->setCol(4, CF_SHOW, tr("suozaibumenzhuanyeshizhiwu"));
    pTableModel->refresh();
	ui->tableView->setColumnWidth(0, 100);
	ui->tableView->setColumnWidth(1, 100);
	ui->tableView->setColumnWidth(2, 100);
	ui->tableView->setColumnWidth(3, 100);
	ui->tableView->setColumnWidth(4, 250);
}

MonthSupervisePlanDetail::~MonthSupervisePlanDetail()
{
    delete ui;
}

void MonthSupervisePlanDetail::on_pushButton_clicked()
{
    this->close();
}
